// 业务管理相关接口xxx
import axios from '../interceptors.js'

// 获取业务线配置项信息
export const getListDetail = (data) => {
  return axios({
    url: '/open/mark-model/' + data,
    method: 'get'
  })
}

// 获取业务线列表 data 是勋章列表和标注方式列表标识
export const getList = (data) => {
  return axios({
    url: `/open/mark-model/list/${data.type}`,
    method: 'get'
  })
}

// 获取keys
export const getKeys = (data) => {
  return axios({
    url: '/open/mark-model/' + data + '/view/history',
    method: 'get'
  })
}

// 选择版本号
export const chooseVersion = (data) => {
  return axios({
    url: '/open/mark-model/' + data.modelId + '/view/' + data.version,
    method: 'post'
  })
}

// 新建、编辑业务线配置项
export const saveListDetail = (data) => {
  console.log(data)
  let url = `/open/mark-model/`;
  if (data.id !== '') {
    url = `/open/mark-model/?modelId=${data.id}`;
  }
  return axios({
    url: url,
    method: 'post',
    data: data.data
  })
}

// 查询工作流taskflow列表
export const getPipeline = (data) => {
  return axios({
    url: '/pipeline/pipelines',
    method: 'get',
    params: data
  })
}
